home *** CD-ROM | disk | FTP | other *** search
/ Small Time Crooks Press Kit / Small Time Crooks Press Kit.iso / pc / Small Time Crooks.dxr / Scripts_17_Follow gCurrent Behavior.ls < prev    next >
Encoding:
Text File  |  2000-04-30  |  1.4 KB  |  48 lines

  1. property pDetailType, pExtension
  2. global gCurrentText, gCurrentPhoto, gCurrentVideo
  3.  
  4. on beginSprite me
  5.   set previousItemDelimiter to the itemDelimiter
  6.   set the itemDelimiter to "."
  7.   set pExtension to item 2 of the name of the member of sprite the spriteNum of me
  8.   set the itemDelimiter to previousItemDelimiter
  9.   UpdateDetail(me, pDetailType)
  10. end
  11.  
  12. on UpdateDetail me, inputDetailType
  13.   if not (inputDetailType = pDetailType) then
  14.     exit
  15.   end if
  16.   case pDetailType of
  17.     #text:
  18.       set rootName to gCurrentText
  19.     #photo:
  20.       set rootName to gCurrentPhoto
  21.     #video:
  22.       set rootName to gCurrentVideo
  23.   end case
  24.   set memberName to rootName & "." & pExtension
  25.   if not (the number of member memberName = -1) then
  26.     set the member of sprite the spriteNum of me to memberName
  27.   end if
  28. end
  29.  
  30. on getPropertyDescriptionList me
  31.   set description to [:]
  32.   addProp(description, #pDetailType, [#default: #text, #format: #symbol, #comment: "Which gCurrent", #range: [#text, #photo, #video]])
  33.   return description
  34. end
  35.  
  36. on getBehaviorDescription me
  37.   set endChar to offset("--END OF HEADER", the text of me)
  38.   set endLine to the number of lines in char 1 to endChar of the text of me - 1
  39.   set description to line 1 to endLine of the text of me
  40.   repeat with whichLine = endLine down to 1
  41.     if line whichLine of description = EMPTY then
  42.       delete line whichLine of description
  43.     end if
  44.   end repeat
  45.   delete line 1 of description
  46.   return description
  47. end
  48.